package com.example.tests.Admin;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.regex.Pattern;

public class AdminSearchHomework {
	private Selenium selenium;

	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:8080/");
		selenium.start();
	}

	@Test
	public void testUntitled() throws Exception {
		selenium.open("/WebDesign/");
		selenium.click("link=登录");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=username", "Administrator");
		selenium.type("id=password", "11111111");
		selenium.click("//input[@value='登录']");
		selenium.waitForPageToLoad("30000");
		selenium.click("//ul[@id='dashboard-menu']/li[4]/a/span");
		selenium.waitForPageToLoad("30000");
		selenium.select("name=teacherid", "label=郑晓玲");
		selenium.select("name=termid", "label=2015/2016（上）");
		selenium.click("id=select");
		selenium.waitForPageToLoad("30000");
	}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
